<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>pdf预览</title>
    <style>
        body {
            display: flex;
            margin: 0;
            flex-direction: column;
            height: 100vh;
        }
        iframe {
            flex: 1;
        }
    </style>
</head>
<body>
    <iframe id="ifr1" src="about:blank" frameborder="0"></iframe>
</body>
<script>
    var url = 'https://mozilla.github.io/pdf.js/legacy/web/compressed.tracemonkey-pldi-09.pdf'
    var src = `http://127.0.0.1:5500/html+css/pdf/viewer.html?url=${encodeURIComponent(url)}`
    document.getElementById('ifr1').src = src
    // https://www.npmjs.com/package/docx-preview
    // https://www.npmjs.com/package/xlsx-preview
</script>
</html>